#include <iostream>
#include <vector>
#include <string>
#include <complex>
#include <tuple>
#include <ratio> // 有理数
#include <array>
#include <forward_list>
#include <unordered_set>
#include <functional>
#include <initializer_list>
#include <ctime>
#include <bitset> // 操作位
#include <deque>
#include <set>
#include <cstring> // strlen()
#include <type_traits>
#include <list>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <stack>
#include <queue>
#include <memory> // allocator
#include <algorithm>
#include <iterator> // ostream_iterator

using namespace std;

// ------------------------------------------------------------------ 43 nullptr
namespace c00 {
void f(int) { cout << "f(int) be called" << endl; }
void f(void*) { cout << "f(void*) be called" << endl; }

void test00_nullptr() {
    cout << "\ntest00_nullptr()........................" << endl;

    // nullptr and std::nullptr_t
    f(0); // f(int)
    //! f(NULL); // call of overloaded 'f(NULL)' is ambiguous
    f(nullptr); // f(void*)，typedef decltype(nullptr) nullptr_t
}
}
// ------------------------------------------------------------------ 61 auto
namespace c01 {
double func() { return 10.0; }

void test01_auto() {
    cout << "\ntest01_auto()........................" << endl;

    // auto declaration
    auto i = 42;
    auto d = func(); // d has type double

    vector<string> vs;
    auto pos = vs.begin(); // vector<string>::iterator
    auto l = [] (int x) -> bool {
        return false;
    };
}
}





// ------------------------------------------------------------------ 1892
//------------------------------------------------------------------- 196
int main(int argc, char** argv) 
{
	cout << __cplusplus << endl; // #define __cplusplus 201402L

 	//space in template expression
	vector<vector<int>> vv;   	//before C++11 ==> [Error] '>>' should be '> >' within a nested template argument list

	c00::test00_nullptr();
	
	c01::test01_auto();
	
	// jj02::test02_uniform_initializer();	
	
	// jj03::test03_initializer_list();
	
	// jj04::test04_explicit_multiple_argument_ctor();	
	
	// jj05::test05_range_based_for();
 	
    // jj06::test06_lambda(); 
    
    // jj07::test07_tuples(); 	

    // jj09::test09_array();
    
    // jj10::test10_forward_list();
	
    // jj11::test11_unordered_set();
  
    // jj12::test12_Rvalue_Move();	
 		
    // jj15::test15_variadic_template();		  
	
	// jj18::test18_decltype(map<string,complex<long>>());
	
	// jj18::test18_decltype(deque<double>());
	
	// jj18::test18_decltype(string());
	
	// //! jj18::test18_decltype(complex<int>());	//這會導致 function template 編譯失敗 
	
	// jj19::test19_default_delete();
	
	// jj23::test23_traits_for_string();
	
	// jj24::test24_traits_for_Foo();	
	
	// jj25::test25_traits_for_Goo();	
	
	// jj26::test26_traits_for_Zoo();
 	
	// jj27::test27_Rvalue_reference();
		
	// jj291::test291_perfect_forward();
	
	// jj301::test301_move_semantics_with_noexcept();

	// jj31::test31_containers_size();
		         					
	// jj34::test34_alias_template();
	
	// jj35::test35_shared_ptr();
		
	// jj36::test36_array_initialized_in_ctor();
	
	// jj37::test37_override_final();
	
	// jj41::test41_bind();
	
	// jj42::test42_bind_and_function();

	// jj45::test45_default_and_delete();
	
	// jj47::test47_template_template_param_vs_iterator_traits();
	
	// jj48::test48_type_alias();		
	
	// jj50::test50_hash();	
		
	return 0;
}
